<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改文章分类')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-category-edit" th:object="${category}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">上级分类：</label>
            <div class="col-sm-8">
                <input class="form-control" name="pid" th:field="*{pid}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">分类名称：</label>
            <div class="col-sm-8">
                <input class="form-control" name="name" th:field="*{name}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">繁体名称：</label>
            <div class="col-sm-8">
                <input class="form-control" name="tName" th:field="*{tName}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">英文名称：</label>
            <div class="col-sm-8">
                <input class="form-control" name="enName" th:field="*{enName}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">分类介绍：</label>
            <div class="col-sm-8">
                <input class="form-control" name="description" th:field="*{description}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">排序：</label>
            <div class="col-sm-8">
                <input class="form-control" name="sort" th:field="*{sort}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">图标：</label>
            <div class="col-sm-8">
                <input class="form-control" name="icon" th:field="*{icon}" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">平台：</label>
            <div class="col-sm-8">
                <select class="form-control m-b" name="platform"
                        th:with="type=${@dict.getType('biz_category_platform')}">
                    <option th:each="dict : ${type}" th:field="*{platform}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('biz_data_state')}">
                    <input name="dataState" th:field="*{dataState}" th:id="${'dataState_' + dict.dictCode}"
                           th:value="${dict.dictValue}" type="radio">
                    <label th:for="${'dataState_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "cms/category";
    $("#form-category-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-category-edit').serialize());
        }
    }
</script>
</body>
</html>